<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <title>Ambari2.7.3.0界面汉化 | rongshen</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  
  
  
<link rel="stylesheet" href="/css/style.css">

  
    
<link rel="stylesheet" href="/css/highlight.css">

  
  <meta name="description" content="主要手段并不是直接修改源码，而是修改编译后的文件，也就是app.js。修改对应的映射关系。">
<meta property="og:type" content="article">
<meta property="og:title" content="Ambari2.7.3.0界面汉化">
<meta property="og:url" content="http://example.com/2020/06/02/Ambari2-7-3-0%E7%95%8C%E9%9D%A2%E6%B1%89%E5%8C%96/index.html">
<meta property="og:site_name" content="rongshen">
<meta property="og:description" content="主要手段并不是直接修改源码，而是修改编译后的文件，也就是app.js。修改对应的映射关系。">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="http://cdn.rongshen2020.com/202062b1.png">
<meta property="og:image" content="http://cdn.rongshen2020.com/202062b2.png">
<meta property="og:image" content="http://cdn.rongshen2020.com/202062b3.png">
<meta property="og:image" content="http://cdn.rongshen2020.com/202062b4.png">
<meta property="og:image" content="http://cdn.rongshen2020.com/202062b5.png">
<meta property="og:image" content="http://cdn.rongshen2020.com/202062b6.png">
<meta property="og:image" content="http://cdn.rongshen2020.com/202062b7.png">
<meta property="og:image" content="http://cdn.rongshen2020.com/202062b8.png">
<meta property="og:image" content="http://cdn.rongshen2020.com/202062b9.png">
<meta property="og:image" content="http://cdn.rongshen2020.com/202062b10.png">
<meta property="og:image" content="http://cdn.rongshen2020.com/202062b11.png">
<meta property="og:image" content="http://cdn.rongshen2020.com/202062b12.png">
<meta property="og:image" content="http://cdn.rongshen2020.com/202062b13.png">
<meta property="og:image" content="http://cdn.rongshen2020.com/202062b14.png">
<meta property="og:image" content="http://cdn.rongshen2020.com/202062b15.png">
<meta property="og:image" content="http://cdn.rongshen2020.com/202062b16.png">
<meta property="og:image" content="http://cdn.rongshen2020.com/202062b17.png">
<meta property="article:published_time" content="2020-06-02T14:47:18.000Z">
<meta property="article:modified_time" content="2020-06-02T15:08:35.067Z">
<meta property="article:author" content="John Doe">
<meta property="article:tag" content="HDP,Ambari">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://cdn.rongshen2020.com/202062b1.png"><meta name="generator" content="Hexo 6.1.0"></head>

<body>
  <div id="wrapper">
    <header id="header">
  <h1 id="title">
    <a href="/">rongshen</a>
  </h1>
  <nav>
    
    
      
      <a class="nav-link" href="/">Home</a>
    
      
        <span class="nav-spacer">×</span>
      
      <a class="nav-link" href="/archives">Archives</a>
    
      
        <span class="nav-spacer">×</span>
      
      <a class="nav-link" target="_blank" rel="noopener" href="https://github.com/Aaron-boom">Github</a>
    
      
        <span class="nav-spacer">×</span>
      
      <a class="nav-link" href="/2020/04/13/About-Me/">About</a>
    
    
  </nav>
</header>

    <div id="content">
      <article id="post-Ambari2-7-3-0界面汉化" class="article article-type-post" itemprop="blogPost" itemscope>
  <div class="article-inner">
    
      <header class="article-header">
        
  
    <h2 class="article-title" itemprop="headline name">
      Ambari2.7.3.0界面汉化
    </h2>
  


        <div class="article-meta">
          <time class="article-date" datetime="2020-06-02T14:47:18.000Z" itemprop="datePublished">2020-06-02</time>

          
        </div>
      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
      
        <blockquote>
<p>主要手段并不是直接修改源码，而是修改编译后的文件，也就是app.js。修改对应的映射关系。</p>
</blockquote>
<span id="more"></span>

<h1 id="1、准备"><a href="#1、准备" class="headerlink" title="1、准备"></a>1、准备</h1><h2 id="1-1、环境准备："><a href="#1-1、环境准备：" class="headerlink" title="1.1、环境准备："></a>1.1、环境准备：</h2><ul>
<li>Amabri版本号：ambari-2.7.3.0-centos7.tar.gz</li>
</ul>
<h2 id="1-2、汉化文件位置："><a href="#1-2、汉化文件位置：" class="headerlink" title="1.2、汉化文件位置："></a>1.2、汉化文件位置：</h2><p><img src="http://cdn.rongshen2020.com/202062b1.png"></p>
<h2 id="1-3、说明："><a href="#1-3、说明：" class="headerlink" title="1.3、说明："></a>1.3、说明：</h2><ul>
<li>这里的汉化，主要针对的是安装后目录文件的汉化，所以在源码文件和编译文件中，代码并没有改动。个人感觉这也是治标不治本的一种汉化手段。</li>
</ul>
<h1 id="二、汉化登录页面举例"><a href="#二、汉化登录页面举例" class="headerlink" title="二、汉化登录页面举例"></a>二、汉化登录页面举例</h1><p>汉化前的登录界面：<br><img src="http://cdn.rongshen2020.com/202062b2.png"><br>cd &#x2F;usr&#x2F;lib&#x2F;ambari-server&#x2F;web&#x2F;javascript<br><img src="http://cdn.rongshen2020.com/202062b3.png"><br>vi app.js<br>&#x2F;Sign in #搜索关键词，再修改<br><img src="http://cdn.rongshen2020.com/202062b4.png"><br><img src="http://cdn.rongshen2020.com/202062b5.png"></p>
<p>汉化后的登录界面，记得刷新：<br><img src="http://cdn.rongshen2020.com/202062b6.png"></p>
<h1 id="三、app-js文件汉化"><a href="#三、app-js文件汉化" class="headerlink" title="三、app.js文件汉化"></a>三、app.js文件汉化</h1><h2 id="3-1、说明："><a href="#3-1、说明：" class="headerlink" title="3.1、说明："></a>3.1、说明：</h2><p>从上面的代码中，我们可以看到，这种简单的界面汉化，就是先找到编译后的js文件——》找到对应的映射关系——》修改——》刷新界面。</p>
<p>汉化前界面：<br><img src="http://cdn.rongshen2020.com/202062b7.png"></p>
<h2 id="3-2、文件准备："><a href="#3-2、文件准备：" class="headerlink" title="3.2、文件准备："></a>3.2、文件准备：</h2><p>建议汉化前先将其备份，防止汉化失败!<br>cd &#x2F;usr&#x2F;lib&#x2F;ambari-server&#x2F;web&#x2F;javascript<br><img src="http://cdn.rongshen2020.com/202062b8.png"><br>汉化的文件：app.js<br>使用xftp软件下载在本地做好备份。<br><img src="http://cdn.rongshen2020.com/202062b9.png"></p>
<h2 id="3-3、汉化："><a href="#3-3、汉化：" class="headerlink" title="3.3、汉化："></a>3.3、汉化：</h2><p>用EditPlus软件打开，直接搜索：Em.I18n.translations<br>一共的代码行有3264行，接下来就是体力活，将对应的英文翻译成中文。<br><img src="http://cdn.rongshen2020.com/202062b10.png"><br><img src="http://cdn.rongshen2020.com/202062b11.png"><br><img src="http://cdn.rongshen2020.com/202062b12.png"></p>
<p>汉化后界面：<br><img src="http://cdn.rongshen2020.com/202062b13.png"><br><img src="http://cdn.rongshen2020.com/202062b14.png"></p>
<h1 id="四、github上项目"><a href="#四、github上项目" class="headerlink" title="四、github上项目"></a>四、github上项目</h1><p>项目地址：<a target="_blank" rel="noopener" href="https://github.com/liuwenru/Apache-Ambari-ZH">https://github.com/liuwenru/Apache-Ambari-ZH</a><br>项目说明：<br>注意该项目是基于ambari2.7.4.0汉化的。</p>
<ul>
<li><p>以下是该开源项目的原话，这是本人转载的，未作为盈利目的。<br>当前Ambari的汉化版本为2.7.4.0.0,汉化采用对该版本的ambari源码直接修改的方式进行,如有翻译不当之处,请批评指正</p>
</li>
<li><p>使用方法如下：<br>message.js 因为ambari的前端是一个纯前端的工程，所以如果你要是想使用的话需要重新编译这个包去使用，在ambari-web上brunch build即可，然后把生成public文件夹覆盖到ambari-server的&#x2F;usr&#x2F;lib&#x2F;ambari-server&#x2F;web目录即可。 或者下载<a target="_blank" rel="noopener" href="https://github.com/liuwenru/Apache-Ambari-ZH/releases/download/v0.1/public.tar.gz">https://github.com/liuwenru/Apache-Ambari-ZH/releases/download/v0.1/public.tar.gz</a> 直接使用。<br><img src="http://cdn.rongshen2020.com/202062b15.png"></p>
</li>
</ul>
<p>app-github.js文件上是第65080-68343行：<br><img src="http://cdn.rongshen2020.com/202062b16.png"><br>app.js文件上是第65030-68293行：<br><img src="http://cdn.rongshen2020.com/202062b17.png"></p>
<h1 id="参考"><a href="#参考" class="headerlink" title="参考"></a>参考</h1><ol>
<li>ambari的汉化：<a target="_blank" rel="noopener" href="https://blog.csdn.net/tancongcong/article/details/94382511">https://blog.csdn.net/tancongcong/article/details/94382511</a></li>
<li>github上已经汉化的项目：<a target="_blank" rel="noopener" href="https://github.com/liuwenru/Apache-Ambari-ZH">https://github.com/liuwenru/Apache-Ambari-ZH</a></li>
<li>Ambari各版本兼容的组件查看路径：<a target="_blank" rel="noopener" href="https://blog.csdn.net/fengfengchen95/article/details/93326440">https://blog.csdn.net/fengfengchen95/article/details/93326440</a></li>
<li>Ambari二次开发：<a target="_blank" rel="noopener" href="https://blog.csdn.net/shirukai/article/details/80841927">https://blog.csdn.net/shirukai/article/details/80841927</a></li>
<li>Ambari多语言处理：<a target="_blank" rel="noopener" href="https://blog.csdn.net/shirukai/article/details/80841925">https://blog.csdn.net/shirukai/article/details/80841925</a></li>
<li>Ambari的各版本下载：<a target="_blank" rel="noopener" href="https://docs.cloudera.com/HDPDocuments/">https://docs.cloudera.com/HDPDocuments/</a></li>
</ol>

      
    </div>
    
    
    <div class="article-category">
      
        <b>Categories:</b>
        <a class="article-category-link" href="/categories/%E5%A4%A7%E6%95%B0%E6%8D%AE%E5%B9%B3%E5%8F%B0/">大数据平台</a>
      
      
        <br/>
      
      
        <b>Tags:</b>
        <a class="article-tag-none-link" href="/tags/HDP-Ambari/" rel="tag">HDP,Ambari</a>
      
    </div>
    
    
  </div>
</article>

  
<nav id="article-nav" class="article-nav">
  
    <a href="/2020/06/17/%E8%A7%A3%E5%86%B3ambari%E7%95%8C%E9%9D%A2quickLinks%E9%93%BE%E6%8E%A5%E6%97%A0%E6%95%88/" id="article-nav-newer" class="article-nav-link-wrap newer">
      <strong class="article-nav-caption">Newer</strong>
      <div class="article-nav-title">
        
          解决ambari界面quickLinks链接无效
        
      </div>
    </a>
  
  
    <a href="/2020/06/02/hdp%E5%92%8Cambari%E7%89%88%E6%9C%AC%E9%80%9F%E6%9F%A5/" id="article-nav-older" class="article-nav-link-wrap older">
      <strong class="article-nav-caption">Older</strong>
      <div class="article-nav-title">
        
          hdp和ambari版本速查
        
      </div>
    </a>
  
</nav>






    </div>
  </div>
  




<div id="settings-container">
  <div id="dark-mode">dark</div>
  <div id="sans-font">sans</div>
</div>
<script type="text/javascript">
let d=document,r=d.documentElement.style,f=r.setProperty.bind(r),l=localStorage,s=l.getItem('s')||(window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches),n=l.getItem('n'),m=d.getElementById("dark-mode"),b=()=>{f('--bg-color','#fafafa');f('--code-bg-color','#f4f4f4');f('--text-color','#212121');f('--secondary-color','#808080');f('--tertiary-color','#b0b0b0');f('--link-color','#b5c8cf');f('--link-hover-color','#618794');f('--link-bg-color','#dae4e7');f('--selection-color','#dae4e7');m.innerHTML="dark"},c=()=>{f('--bg-color','#212121');f('--code-bg-color','#292929');f('--text-color','#fff');f('--secondary-color','#c0c0c0');f('--tertiary-color','#6e6e6e');f('--link-color','#4d6b75');f('--link-hover-color','#96b1bb');f('--link-bg-color','#5d828e');f('--selection-color','#acc1c9');m.innerHTML="light"},o=d.getElementById("sans-font"),e=()=>{f('--body-stack','"Lora", "Georgia", "Times New Roman", serif');o.innerHTML="sans"},g=()=>{f('--body-stack','"Lato", "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", "Verdana", sans-serif');o.innerHTML="serif"};m.onclick=()=>{if(s==2){s=1;l.setItem('s',s);c()}else{s=2;l.setItem('s',s);b()}};o.onclick=()=>{if(n==2){n=1;l.setItem('n',n);g()}else{n=2;l.setItem('n',n);e()}};if(!s){s=2;l.setItem('s',2)};if(s==1){c()};if(!n){n=2;l.setItem('n',2)};if(n==1){g()};
</script>




</body>
</html>
